Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent info from running unnecessarily #1650

Merged
merged 7 commits into from
Jun 30, 2020

Conversation

jamesgeorge007
Copy link
Member

@jamesgeorge007 jamesgeorge007 commented Jun 25, 2020

What kind of change does this PR introduce?
bugfix

Did you add tests for your changes?
Yup

If relevant, did you update the documentation?
Nope

Summary

  • Make use of commander.js to parse the available commands.
  • Prevents info from running unnecessarily.

Does this PR introduce a breaking change?
Nope

Other information
N/A

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, can you provide example of --help, because now commander can do it, also i think here couple places for refactoring, but it is not high priority right now

@jamesgeorge007
Copy link
Member Author

webpack-cli --help shows up the custom help information since we're overriding the default behavior.

          ⬡                     webpack                     ⬡

		         https://webpack.js.org

		The build tool for modern web applications

		Usage: `webpack [...options] | <command>`

		Example: `webpack help --flag | <command>`



Available Commands

  init | c      Initialize a new webpack configuration                 
  migrate | m   Migrate a configuration to a new version               
  loader | l    Scaffold a loader repository                           
  plugin | p    Scaffold a plugin repository                           
  info | i      Outputs information about your system and dependencies 
  serve | s     Run the webpack Dev Server                             

Options

  --entry string[]         The entry point(s) of your application e.g.          
                           ./src/main.js                                        
  -c, --config string      Provide path to a webpack configuration file e.g.    
                           ./webpack.config.js                                  
  -m, --merge string       Merge a configuration file using webpack-merge e.g.  
                           ./webpack.config.js                                  
  --progress               Print compilation progress during build              
  --silent                 Disable any output that webpack makes                
  --help                   Outputs list of supported flags                      
  -o, --output string      Output location of the file generated by webpack     
                           e.g. ./dist/                                         
  -t, --target string      Sets the build target e.g. node                      
  -w, --watch              Watch for files changes                              
  -h, --hot                Enables Hot Module Replacement                       
  --no-hot                 Disables Hot Module Replacement                      
  -s, --sourcemap string   Determine source maps to use                         
  --prefetch string        Prefetch this request                                
  -j, --json               Prints result as JSON                                
  -d, --dev                Run development build                                
  -p, --prod               Run production build                                 
  --mode string            Defines the mode to pass to webpack                  
  -v, --version            Get current version                                  
  --node-args string[]     NodeJS flags                                         
  --stats string           It instructs webpack on how to treat the stats e.g.  
                           verbose                                              
  --verbose                It tells webpack to output all the information       
  --env string             Environment passed to the configuration when it is a 
                           function                                             

                  Made with ♥️  by the webpack team

@jamesgeorge007
Copy link
Member Author

Let's revisit the refactoring part in a future PR 👍

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @webpack/cli-team

snitin315
snitin315 previously approved these changes Jun 29, 2020
@webpack-bot
Copy link

@jamesgeorge007 Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@snitin315 Please review the new changes.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

Copy link
Member

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work.

@jamesgeorge007 jamesgeorge007 merged commit ddee5ad into webpack:next Jun 30, 2020
@jamesgeorge007 jamesgeorge007 deleted the hotfix/parse-args branch June 30, 2020 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

webpack-cli info being run when not desired
4 participants